package com.naiterui.ehp.bs.agent.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bs.agent.entity.AsProviceCount;

/**
 * 经纪人数据统计-省区数据统计表
 *
 * @author yangfuya
 * @since 2022/2/22
 */
@Repository
public interface IAsProviceCountRepository extends BaseJpaRepository<AsProviceCount, Long> {

    @Query(value = "SELECT * FROM as_provice_count WHERE TO_DAYS(:yesterday) - TO_DAYS(generate_date) = 1",
        nativeQuery = true)
    List<AsProviceCount> getYesterday(@Param("yesterday") String yesterday);
}
